package com.ccn.shardingjdbc.mapper;

import com.ccn.shardingjdbc.entity.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wangxy
 * @date 2021/7/2 11:29
 */
@Repository
public interface UsersMapper {
    @Insert("insert into users(id,name,age) values(#{id},#{name},#{age})")
    void addUser(Users user);
    /**
     * @author 学相伴-飞哥
     * @description 保存用户
     * @params [user]
     * @date 2021/3/10 17:14
     */
    @Select("select * from users")
    List<Users> findUsers();

}
